﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EFCoreRepository.DbContexts;
using EFCoreRepository.Extensions;
using EFCoreRepository.Repositories;
using Zoomtel.Entity.BIZ;
using Zoomtel.Persist.BIZ.Models;
using Zoomtel.Persist.Query;

namespace Zoomtel.Persist.BIZ
{
    public class BankRepository : RepositoryAb<BankEntity>
    {
        public BankRepository(DefaultDbContext context) : base(context)
        {
        }
        public async Task<List<BankEntity>> Query(BankEntity model)
        {
            var query = dbSet.AsQueryable();
            if (!model.BankName.IsNull())
            {
                query = query.Where(a => a.BankName.Contains(model.BankName));
            }
            if (!model.Status.IsNull())
            {
                query = query.Where(a => a.Status.Contains(model.Status));
            }
         
        
                query = query.OrderBy(m => m.Sort);
         
            //query.Skip()
            return query.ToList();
        }

    }
}
